<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    <title>车辆信息展示</title>
    <style type="text/css">
    </style>
<link rel="stylesheet" href="<%=basePath%>ext3.4/resources/css/ext-all.css" type="text/css"></link>
<link rel="stylesheet" href="<%=basePath%>ext3.4/ux/fileuploadfield/css/fileuploadfield.css" type="text/css"></link>
<script type="text/javascript" src="<%=basePath%>ext3.4/adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="<%=basePath%>ext3.4/ext-all.js"></script>
<script type="text/javascript" src="<%=basePath%>ext3.4/ux/fileuploadfield/FileUploadField.js"></script>
<script type="text/javascript" src="<%=basePath%>ext3.4/src/locale/ext-lang-zh_CN.js"></script>
<link rel="stylesheet" href="<%=basePath%>css/ext_icon.css" type="text/css"></link>
<style type="text/css">
	.d_t{ border:1px solid #cdcdcd;}
	.d_t td,.d_t th{font-size:14px; text-align:right; color:#555; padding:10px 15px;}
	.d_t .tit,h3{ background:#00afb9; color:#fff; height:40px; font-size:16px; text-align:left;padding:0 0 0 15px; font-weight:bold;}
	h3{line-height:40px; margin:0; padding:0 0 0 15px; margin-top:30px;}
	th.t_r{ padding-left:60px;}
	.d_t .d_r{ text-align:left;}
	p a{ display:inline-block; width:112px; height:32px; background:url(b_g.gif) no-repeat 0 0;font-weight:bold; color:#333; font-size:14px; margin:0 15px 20px 15px;}
	p a:hover{ background:url(b_g.gif) 0 -33px no-repeat;}
	.img_box{ width:490px;}
	.img_box span{ display:inline-block; margin:20px 20px 0 0;}
	.img_box span a{ margin-left:10px;}
</style>
  </head>
  <script type="text/javascript">
  	function showWaitMsg(msg) {
		Ext.MessageBox.show({
					title : '系统提示',
					msg : msg == null ? '正在处理数据,请稍候...' : msg,
					progressText : 'processing now,please wait...',
					width : 300,
					wait : true,
					waitConfig : {
						interval : 150
					}
				});
	};
	
  	
  	function showAddImageWin(uid){
  		var fp = new Ext.FormPanel({
  			id:'carImageFormPanel',
	        fileUpload: true,
	        width: 500,
	        border:false,
	        autoHeight: true,
	        layout:'form',
	        bodyStyle: 'padding: 10px 10px 0 10px;',
	        labelWidth: 50,
	        defaults: {
	            anchor: '90%',
	            allowBlank: false,
	            msgTarget: 'side'
	        },
	        items: [{
	        	xtype:'hidden',
	        	fieldLabel: 'UID',
	        	name:'uid',
	        	value:uid
	        },{
	            xtype: 'fileuploadfield',
	            emptyText: '选择车辆图片',
	            fieldLabel: '图片',
	            name: 'image',
	            buttonText: '选择...'
	        }]
	    });
  		var win = new Ext.Window({
  			title:'车辆图片上传',
  			layout:'fit',
  			width:300,
  			modal:true,
  			items:[fp],
  			buttons:[{
  				text:'增加表单',
  				handler:function(){
  					var panel = Ext.getCmp('carImageFormPanel');
  					panel.add({
  						xtype: 'fileuploadfield',
			            emptyText: '选择车辆图片',
			            fieldLabel: '图片',
			            name: 'image',
			            buttonText: '选择...'
  					});
  					panel.doLayout();
  				}
  			},{
  				text:'上传图片',
  				handler:function(){
  					Ext.getCmp('carImageFormPanel').form.submit({
  						url : 'carInfo/addCarImage02.action',
						waitTitle : '提示',
						method : 'POST',
						waitMsg : '图片正在上传,请稍候.....',
  						success : function(form, action) {
							Ext.Msg.alert('提示','上传成功，请重新载入窗口查看效果.');
							win.destroy();
						},
						failure : function(form, action) {
							Ext.Msg.alert('提示','上传失败，请联系管理员');
						}
  					});
  				}
  			}]
  		});
  		win.show();
  	}
  	
  	function delCarImage(uid,id){
  		showWaitMsg("正在删除图片,请等待...");
  		Ext.Ajax.request({
  			url:'carInfo/delCarImage.action',
  			params:{
  				uid:uid,
  				id:id
  			},
  			success:function(response){
  				Ext.Msg.alert('提示','删除成功，请重新载入窗口查看效果');
  			},
  			failure:function(){
  				Ext.Msg.alert('提示','删除失败。');
  			}
  		});
  	}
  	
  	function delDriver(id,uid){
  		showWaitMsg("正在删除信息,请等待...");
  		Ext.Ajax.request({
  			url:'carInfo/delCarDriver.action',
  			params:{
  				uid:uid,
  				id:id
  			},
  			success:function(response){
  				Ext.Msg.alert('提示','删除成功，请重新载入窗口查看效果');
  			},
  			failure:function(){
  				Ext.Msg.alert('提示','删除失败。');
  			}
  		});
  	}
  	
  	
  	function showAddDriverWin(uid){
  		var addDriverPanel = new Ext.form.FormPanel({
  			id:'addDriverPanel',
	        fileUpload: true,
	        width: 500,
	        border:false,
	        autoHeight: true,
	        layout:'form',
	        bodyStyle: 'padding: 10px 10px 0 10px;',
	        labelWidth: 80,
	        defaults: {
	            anchor: '90%',
	            allowBlank: false,
	            msgTarget: 'side'
	        },
	        items: [{
	        	xtype:'hidden',
	        	fieldLabel: 'UID',
	        	name:'uid',
	        	value:uid
	        },{
	        	xtype:'textfield',
	        	fieldLabel:'姓名',
	        	name:'driverName'
	        },{
	            xtype: 'fileuploadfield',
	            emptyText: '选择驾驶员图片',
	            fieldLabel: '照片',
	            name: 'image',
	            buttonText: '选择...'
	        },{
	        	xtype:'textfield',
	        	fieldLabel:'身份证',
	        	name:'idCard'
	        },{
	        	xtype:'textfield',
	        	fieldLabel:'住址',
	        	name:'address'
	        },{
	        	xtype:'textfield',
	        	fieldLabel:'电话',
	        	name:'telphone'
	        },{
	        	xtype:'textfield',
	        	fieldLabel:'驾驶证号',
	        	name:'drivingLicenceNum'
	        },{
	        	xtype:'textfield',
	        	fieldLabel:'准驾驶证号',
	        	name:'drivingPermitNum'
	        },{
	        	xtype:'textfield',
	        	fieldLabel:'准驾车型',
	        	name:'drivingPermitType'
	        },{
	        	xtype:'textfield',
	        	fieldLabel:'准驾该车时间',
	        	name:'drivingPermitDate'
	        },{
	        	xtype:'textfield',
	        	fieldLabel:'准驾开始年限',
	        	name:'quasiDriverYear'
	        },{
	        	xtype:'textfield',
	        	fieldLabel:'准驾结束年限',
	        	name:'quasiDriverYear02'
	        }]
	    });
  		var win1 = new Ext.Window({
  			title:'增加驾驶员信息',
  			layout:'fit',
  			width:320,
  			modal:true,
  			items:[addDriverPanel],
  			buttons:[{
  				text:'添加',
  				handler:function(){
  					Ext.getCmp('addDriverPanel').form.submit({
  						url : 'carInfo/addCarDriver02.action',
						waitTitle : '提示',
						method : 'POST',
						waitMsg : '正在添加驾驶员,请稍候.....',
  						success : function(form, action) {
							Ext.Msg.alert('提示','添加成功，请重新载入窗口查看效果.');
							win1.destroy();
						},
						failure : function(form, action) {
							Ext.Msg.alert('提示','添加失败，请联系管理员');
						}
  					});
  				}
  			}]
  		});
  		win1.show();
  	}
  	
  	function editCarBaseInfo(uid){
  		var tabPanel = window.parent.abc();
		if(!Ext.isEmpty(tabPanel)){
			var tabs = tabPanel.getComponent("editCarBaseInfo");
			if(!tabs){
				tabs =	tabPanel.add({
		       		id:'editCarBaseInfo',
		            title:'修改车辆信息', 
		           	html : '<iframe id="myframe" name="myframe" scrolling="auto" frameborder="0" width="100%" height="100%" allowtransparency="yes"  src="carInfo/editCarBaseInfoPage.action?uid='+uid+'"></iframe>',
		            closable:true
				});
			}
			tabPanel.setActiveTab(tabs);
		}
  	}
  	
  	function editCarDriverInfo(uid,id){
  		var tabPanel = window.parent.abc();
		if(!Ext.isEmpty(tabPanel)){
			var tabs = tabPanel.getComponent("editCarDriverInfo");
			if(!tabs){
				tabs =	tabPanel.add({
		       		id:'editCarDriverInfo',
		            title:'修改车辆驾驶员信息', 
		            html : '<iframe id="myframe" name="myframe" scrolling="auto" frameborder="0" width="100%" height="100%" allowtransparency="yes"  src="carInfo/editCarDriverPage.action?uid='+uid+'&id='+id+'"></iframe>',
		            closable:true
				});
			}
			tabPanel.setActiveTab(tabs);
		}
  	}
  	function editVehicleInfo(uid){
  		var tabPanel = window.parent.abc();
		if(!Ext.isEmpty(tabPanel)){
			var tabs = tabPanel.getComponent("editVehicleInfo");
			if(!tabs){
				tabs =	tabPanel.add({
		       		id:'editVehicleInfo',
		            title:'修改车辆基本参数', 
		            html : '<iframe id="myframe" name="myframe" scrolling="auto" frameborder="0" width="100%" height="100%" allowtransparency="yes"  src="carInfo/editVehicleInfoPage.action?uid='+uid+'"></iframe>',
		            closable:true
				});
			}
			tabPanel.setActiveTab(tabs);
		}
  	}
  	
  	function editEngineInfo(uid){
  		var tabPanel = window.parent.abc();
		if(!Ext.isEmpty(tabPanel)){
			var tabs = tabPanel.getComponent("editEngineInfo");
			if(!tabs){
				tabs =	tabPanel.add({
		       		id:'editEngineInfo',
		            title:'修改车辆发动机参数', 
		            html : '<iframe id="myframe" name="myframe" scrolling="auto" frameborder="0" width="100%" height="100%" allowtransparency="yes"  src="carInfo/editEngineInfoPage.action?uid='+uid+'"></iframe>',
		            closable:true
				});
			}
			tabPanel.setActiveTab(tabs);
		}
  	}
  	function editChassisInfo(uid){
  		var tabPanel = window.parent.abc();
		if(!Ext.isEmpty(tabPanel)){
			var tabs = tabPanel.getComponent("editChassisInfo");
			if(!tabs){
				tabs =	tabPanel.add({
		       		id:'editChassisInfo',
		            title:'修改车辆地盘参数', 
		            html : '<iframe id="myframe" name="myframe" scrolling="auto" frameborder="0" width="100%" height="100%" allowtransparency="yes"  src="carInfo/editChassisInfoPage.action?uid='+uid+'"></iframe>',
		            closable:true
				});
			}
			tabPanel.setActiveTab(tabs);
		}
  	}
  </script>
  <body>
 <table class="d_t">
   <tr><td colspan="4" class="tit" valign="middle">车辆基本信息</td></tr>
   	<tr> <th>车辆单位:</th><td>${requestScope.carBaseInfo.carUnit }</td><th class="t_r">档号:</th><td>${requestScope.carBaseInfo.fileNum }</td> </tr>
   	<tr> <th>自编号码:</th><td>${requestScope.carBaseInfo.artificialNum }</td><th class="t_r">牌照号码:</th><td>${requestScope.carBaseInfo.licensePlate }</td> </tr>
   	<tr> <th>编制日期:</th><td>${requestScope.carBaseInfo.prepareDate }</td><th class="t_r">车辆型号:</th><td>${requestScope.carBaseInfo.vehicleModel }</td> </tr>
   	<tr> <th>类别:</th><td>${requestScope.carBaseInfo.vehicleType }</td> <th class="t_r">道路运输证号:</th><td>${requestScope.carBaseInfo.roadTransportNum }</td></tr>
   	<tr> <th>行驶证号:</th><td>${requestScope.carBaseInfo.drivingLicenseNum }</td><th class="t_r">车辆技术等级:</th><td>${requestScope.carBaseInfo.vehicleTechnologyLevel }</td> </tr>
   	<tr> <th>燃油类型:</th><td>${requestScope.carBaseInfo.fuelType }</td> <th class="t_r">客车等级类型:</th><td>${requestScope.carBaseInfo.carLevelType }</td></tr>
   	<tr> <th>使用性质:</th><td>${requestScope.carBaseInfo.useProperty }</td><th class="t_r">购置日期:</th><td>${requestScope.carBaseInfo.acquisitionDate }</td> </tr>
   	<tr> <th>投产日期:</th><td>${requestScope.carBaseInfo.commissioningDate }</td> <th class="t_r">发动机号:</th><td>${requestScope.carBaseInfo.engineNum }</td></tr>
   	<tr> <th>底盘号:</th><td>${requestScope.carBaseInfo.turfNum }</td><th class="t_r">车属企业:</th><td>${requestScope.carBaseInfo.carCompany }</td> </tr>
   	<tr> <th>法人:</th><td>${requestScope.carBaseInfo.legalPerson }</td><th class="t_r">电话:</th><td>${requestScope.carBaseInfo.legalPersonPhone }</td> </tr>
   	<tr> <th>车主姓名:</th><td>${requestScope.carBaseInfo.carOwner }</td> <th class="t_r">车主电话:</th><td>${requestScope.carBaseInfo.carOwnerPhone }</td> </tr>
   	<tr> <th>居住地址:</th><td>${requestScope.carBaseInfo.address }</td><th>&nbsp;</th><td>&nbsp;</td> </tr>
  </table>
   <p><a href="javascript:void(0);" onclick="editCarBaseInfo('${requestScope.uid }');">修改</a></p> 
 <hr/>
 
 <div class="img_box">
	<table class="d_t">
    <tr><td class="tit">车辆图片</td></tr>
    <tr><td>
   	<s:iterator value="#request.carImages" var="c" status="carImage">
	    <span><img alt="这是图片" src="${c.relativePath}" height="50" width="50"/><a href="javascript:void(0);" onclick="delCarImage('${requestScope.uid }','${c.id}')">删除</a></span>
   	</s:iterator>
	</td></tr>
	</table>
    <p><a href="javascript:void(0);" onclick="showAddImageWin('${requestScope.uid }')">增加</a></p>
</div>
<hr/>

    <table cellpadding="0" cellspacing="0" class="d_t">
    <tr><td colspan="4" class="tit">车辆驾驶员信息</td></tr>
    <s:iterator value="#request.carDrivers" var="carDriver" status="driver">
    <tr> <th>姓名:</th><td>${carDriver.driverName}</td><th>照片:</th><td class="d_r"><img alt="这是图片" height="50" width="50" src="${carDriver.relativePhotoPath}"/></td>  </tr>
    <tr> <th>身份证号:</th><td>${carDriver.idCard}</td><th class="t_r">住所:</th><td class="d_r">${carDriver.address}</td> </tr>
    <tr> <th>电话:</th><td>${carDriver.telphone}</td><th class="t_r">驾驶证号:</th><td class="d_r">${carDriver.drivingLicenceNum}</td> </tr>
    <tr> <th>准驾证号:</th><td>${carDriver.drivingPermitNum}</td><th class="t_r">准驾车型:</th><td class="d_r">${carDriver.drivingPermitType}</td>  </tr>
    <tr> <th>准驾该车时间:</th><td>${carDriver.drivingPermitDate}</td><th class="t_r">驾驶期限:</th><td class="d_r">${carDriver.quasiDriverYear}&nbsp;&nbsp;到&nbsp;&nbsp;${carDriver.quasiDriverYear02}年</td> </tr>
    <tr><td colspan="4" style="height:32px;"><p style="text-align:left; margin:0; padding:0" ><a href="javascript:void(0);" onclick="editCarDriverInfo('${carDriver.uid }','${carDriver.id}')">修改</a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="javascript:void(0)" onclick="delDriver('${carDriver.id}','${carDriver.uid}')">删除</a></p></td></tr>
    </s:iterator>
   </table>
    <p><a href="javascript:void(0);" onclick="showAddDriverWin('${requestScope.uid }')">新增</a></p>
    <hr/>

<table class="d_t">
   <tr><td colspan="4" class="tit">车辆技术概况及参数</td></tr>
  	<tr> <th>厂牌型号:</th><td>${requestScope.carVehicle.labelType }</td> <th class="t_r">车辆类别:</th><td>${requestScope.carVehicle.vehicleCategory }</td></tr>
  	<tr> <th>制造厂家:</th><td>${requestScope.carVehicle.manufacturer }</td> <th class="t_r">驱动形式:</th><td>${requestScope.carVehicle.driveForm }</td></tr>
  	<tr> <th>发动机位置:</th><td>${requestScope.carVehicle.enginePosition }</td> <th class="t_r">驾驶室车型:</th><td>${requestScope.carVehicle.cabCar }</td></tr>
  	<tr> <th>驾驶室座位数:</th><td>${requestScope.carVehicle.cockpitSeats }</td><th class="t_r">载重量:</th><td>${requestScope.carVehicle.deadWeight }</td>  </tr>
  	<tr> <th>车辆自重:</th><td>${requestScope.carVehicle.lightWeight }</td> <th class="t_r">最高车速:</th><td>${requestScope.carVehicle.topSpeed }</td></tr>
  	<tr> <th>前后轴距:</th><td>${requestScope.carVehicle.wheelbase }</td> <th class="t_r">前轮距:</th><td>${requestScope.carVehicle.wheelTrack }</td></tr>
  	<tr> <th>后轮距:</th><td>${requestScope.carVehicle.wheelTrack02 }</td><th class="t_r">外形尺寸:</th><td>${requestScope.carVehicle.overallDimensions }</td> </tr>
  	<tr> <th>最小转弯直径:</th><td>${requestScope.carVehicle.minTurningDiameter }</td><th class="t_r">制动距离:</th><td>${requestScope.carVehicle.brakingDistance }</td> </tr>
  	<tr> <th>燃油消耗量:</th><td>${requestScope.carVehicle.fuelConsumption }</td><th class="t_r">最小离地间距:</th><td>${requestScope.carVehicle.minDistanceFromEarth }</td> </tr>
  	<tr> <th>最大爬坡度:</th><td>${requestScope.carVehicle.maximumGradability }</td><th class="t_r">油箱容量:</th><td>${requestScope.carVehicle.fuelTankCapacity }</td> </tr>
  	<tr> <th>备注:</th><td colspan="3" style="text-align:left">${requestScope.carVehicle.remark }</td> </tr>
</table>
 <p><a href="javascript:void(0);" onClick="editVehicleInfo('${requestScope.uid}')">修改</a></p>
<hr/>
        
<table class="d_t">
   <tr><td colspan="4" class="tit">发动机技术参数</td> </tr>
  	<tr> <th>型号:</th><td>${requestScope.carEngine.model }</td><th class="t_r">形式:</th><td>${requestScope.carEngine.form }</td> </tr>
  	<tr> <th>制造厂:</th><td>${requestScope.carEngine.manufacturingPlant }</td><th class="t_r">汽缸数与排列:</th><td>${requestScope.carEngine.cylinderArrangement }</td> </tr>
  	<tr> <th>排量:</th><td>${requestScope.carEngine.displacement }</td><th class="t_r">缸径与行程:</th><td>${requestScope.carEngine.boreAndStroke }</td></tr>
  	<tr> <th>压缩比:</th><td>${requestScope.carEngine.compressionRatio }</td> <th class="t_r">启动方式:</th><td>${requestScope.carEngine.startupMode }</td></tr>
  	<tr> <th>气缸工作顺序:</th><td>${requestScope.carEngine.workOrder }</td><th class="t_r">最大功率:</th><td>${requestScope.carEngine.mostPowerful }</td> </tr>
  	<tr> <th>最大扭矩:</th><td>${requestScope.carEngine.maximumTorque }</td> <th class="t_r">冬季机油种类:</th><td>${requestScope.carEngine.oilTypes }</td> </tr>
  	<tr> <td>夏季机油种类:</td><td>${requestScope.carEngine.oilTypes02 }</td> <th class="t_r">&nbsp;</th><td>&nbsp;</td></tr>
   <tr><th>备注:</th><td colspan="3" style="text-align:left">${requestScope.carEngine.remark }</td></tr>
</table>
<p><a href="javascript:void(0);" onClick="editEngineInfo('${requestScope.uid }')">修改</a></p>

<table class="d_t">
    <tr><td colspan="4" class="tit">底盘技术参数</td></tr>
   	<tr> <th>离合器形式:</th><td>${requestScope.carChassis.clutch }</td> <th class="t_r">变速器形式与排挡数:</th><td>${requestScope.carChassis.transmission }</td></tr>
   	<tr> <th>传动轴形式与数量:</th><td>${requestScope.carChassis.shaft }</td><th class="t_r">主传动器:</th><td>${requestScope.carChassis.mainTransmission }</td> </tr>
   	<tr> <th>减速比:</th><td>${requestScope.carChassis.reductionRatio }</td> <th class="t_r">桥壳:</th><td>${requestScope.carChassis.bridgeShell }</td> </tr>
   	<tr> <th>半轴:</th><td>${requestScope.carChassis.halfShaft }</td><th class="t_r">差速器:</th><td>${requestScope.carChassis.differential }</td> </tr>
   	<tr> <th>前悬架形式:</th><td>${requestScope.carChassis.frontSuspension }</td><th class="t_r">后悬架形式:</th><td>${requestScope.carChassis.afterSuspension }</td> </tr>
   	<tr> <th>轮胎:</th><td>${requestScope.carChassis.tire }</td><th class="t_r">轮胎规格:</th><td>${requestScope.carChassis.tireSize }</td> </tr>
   	<tr> <th>前轮气压:</th><td>${requestScope.carChassis.wheelPressure }</td><th class="t_r">后轮气压:</th><td>${requestScope.carChassis.wheelPressure02 }</td> </tr>
   	<tr> <th>轮刚:</th><td>${requestScope.carChassis.rim }</td><th class="t_r">备胎架位置及结构形式:</th><td>${requestScope.carChassis.spareTire }</td> </tr>
   	<tr> <th>转向器形式:</th><td>${requestScope.carChassis.steeringGear }</td><th class="t_r">前制动形式:</th><td>${requestScope.carChassis.brakeFormBefore }</td> </tr>
   	<tr> <th>后制动形式:</th><td>${requestScope.carChassis.brakingAfter }</td><th class="t_r">&nbsp;</th><td>&nbsp;</td> </tr>
   	<tr> <th>备注:</th><td colspan="3" style="text-align:left">${requestScope.carChassis.remark }</td> </tr>
</table>
   <p><a href="javascript:void(0);" onClick="editChassisInfo('${requestScope.uid }')">修改</a></p>
  </body>
</html>
